
  <h1>日志列表</h1>

  <table class="table table-striped">
    <thead>
      <tr>
        <th>标题</th>
        <th>摘要</th>
        <th>发布时间</th>
        <th colspan="3"></th>
      </tr>
    </thead>

    <tbody>
      <% @posts.each do |post| %>
        <tr>
          <td><%= post.title %></td>
          <td><%= post.abstract %></td>
          <td><%= post.created_at.to_formatted_s(:db) %></td>
          <td><%= link_to 'Show', post %></td>
          <td><%= link_to 'Edit', edit_post_path(post) %></td>
          <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: "确认要删除日志？" } %></td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <br>
  <a class="btn btn-primary" href="<%=new_post_path%>">添加日志</a>
